<template>
  <div class="app">
    <span class="zb" >
<mai-gou :todos="sj" @btn="btn"/>

</span><div style="float:right;">
  <h3>选择你要买的</h3>
<ul >
  <li v-for="(iteml,index1) in mg" :key="index1" @click="del(index1)">{{iteml}}</li>
</ul>
</div>
  </div>
</template>

<script>
import MaiGou from './components/MaiGou'

export default {
  data () {
    return {
      sj: [
        {
          dogImgUrl:
        'http://nwzimg.wezhan.cn/contents/sitefiles2029/10146688/images/21129958.jpg',
          dogName: '博美'
        },
        {
          dogImgUrl:
        'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1224576619,1307855467&fm=26&gp=0.jpg',
          dogName: '泰迪'
        },
        {
          dogImgUrl:
        'https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2967740259,1518632757&fm=26&gp=0.jpg',
          dogName: '金毛'
        },
        {
          dogImgUrl:
        'https://pic1.zhimg.com/80/v2-7ba4342e6fedb9c5f3726eb0888867da_1440w.jpg?source=1940ef5c',
          dogName: '哈士奇'
        },
        {
          dogImgUrl:
        'https://tse1-mm.cn.bing.net/th/id/OIP-C.lIOwY_fYP0ZS-kkuTiMd1QHaFj?w=264&h=198&c=7&r=0&o=5&dpr=1.25&pid=1.7',
          dogName: '阿拉斯加'
        },
        {
          dogImgUrl: 'http://sz.btfs.mail.ftn.qq.com/ftn_handler/37dc38b0f54e9bf0fe5aae378e8005b578124a69a270d7efeb75c69230fa5c1aab1b0e46959d777c1dfc4568d2e07c8a2fec85f75dae052a2dc46ff2aacd2356?compressed=0&dtype=4&fname=magic...&size=160*160&pictype=scaled',
          dogName: '单身狗'
        }
      ],
      mg: []
    }
  },

  created () {

  },

  methods: {
    btn (e) {
      this.mg.push(this.sj[e].dogName)
    },
    del (e) {
      this.mg.splice(e, 1)
    }

  },
  components: {
    MaiGou
  }
}
</script>

<style scoped lang='less'>
.app {
  width: 750px;
  .zb {
    display: inline-block;
    width: 610px;
  }
}
</style>
